*"Dixie's Drivers: Core Values and the Southern Republican Realignment*

*This project analyzes the sources of partisan change among southerners*
*and non-southerners from 1988 to 2016*
*This project was conducted collaboratively with Seth C. McKee of Texas*
*Tech University*

*This Stata do file incorporates all of the analysis variables in the main* 
*Stata do file, plus presidential and congressional vote choice variables*

*This Stata do file features code used to analyze both the 2016 American *
*National Election Studies (ANES) the ANES Cumulative File (1948-2012)*

*This do file produces some analyses that appear in the published* 
*Journal of Politics article's supplemental online appendix*

*Thurs. 4 October 2018*
*Friday 5 October 2018*
*Mon. 8 October 2018*
*Thurs. 24 January 2019*
*Friday 25 January 2019*

***************
*This analysis first requires that the researcher download the ANES Cumulative*
*File (1948-2012), which is saved as the following Stata Data* 
*file: "ANES Cumulative File (1948-2012).dta"*
****************

set more off
set matsize 10000
keep if VCF0004 > 1986
drop if VCF0004 == 1990 
drop if VCF0004 == 1994
drop if VCF0004 == 1996
drop if VCF0004 == 1998
drop if VCF0004 == 2002

****************
*Recode demographic control variables*

*Note: These variables will be included as control variables in the* 
*empirical analysis predicting partisanship*
****************

*Note: Our empirical analysis throughout this entire manuscript will focus*
*exclusively on whites given our goal to understand whites' partisan change*
*during this period*

*Race*

gen White = .
replace White = 1 if VCF0105a == 1
label var White ///
"White"
label define Whites ///
0 "Non-white" 1 "Whites" 
label values White Whites

keep if White == 1

*Gender*

gen Gender = VCF0104
replace Gender = . if VCF0104 == 0
replace Gender = 0 if VCF0104 == 1
replace Gender = 1 if VCF0104 == 2
label var Gender ///
"Respondent Gender"
label define Sex 0 "0 Male" 1 "1 Female"
label values Gender Sex

*Age*

gen Age = VCF0101
replace Age = . if VCF0101 == 00
replace Age = . if VCF0101 == 97
replace Age = . if VCF0101 == 99
label var Age "Respondent Age"

*Education*

gen Education = VCF0110
replace Education = . if VCF0110 == 0
label var Education ///
"Respondent's Education"
label define Educationlevel ///
1 "1 Less than high school" 2 "2 High school diploma" 3 "3 Some college" ///
4 "4 College or advanced degree"
label values Education Educationlevel

*Income*

gen Income = VCF0114
replace Income = . if VCF0114 == 0

****************
*Recode the region variable*

*Note: For the empirical analysis, "South" will be compared to the*
*other regions (identified as "East," "Midwest" and "West," respectively)*

*Note: "South" is defined as the eleven states of the former Confederacy,*
*Alabama, Arkansas, Georgia, Florida, Louisiana, Mississippi, North Carolina,* 
*South Carolina, Tennessee, Texas and Virginia*
****************

*South*

gen South = .
replace South = 0 if VCF0113 == 2
replace South = 1 if VCF0113 == 1

label var South ///
"South Region Dummy"
label define Southern ///
0 "0 Non-South" 1 "1 South"
label values South Southern

****************
*Recode symbolic predispositions*
****************

*Party identification*

*Note: Partisanship runs from "strong Democrat" (0)* 
*to "strong Republican" (6), and thus 3 represents true political independents*

gen Partyid = VCF0301
replace Partyid = . if VCF0301 == 0
replace Partyid = 0 if VCF0301 == 1
replace Partyid = 1 if VCF0301 == 2
replace Partyid = 2 if VCF0301 == 3
replace Partyid = 3 if VCF0301 == 4
replace Partyid = 4 if VCF0301 == 5
replace Partyid = 5 if VCF0301 == 6
replace Partyid = 6 if VCF0301 == 7
label var Partyid ///
"Party Identification"

*Ideology*
*Note: Ideology runs from "extremely liberal" (0) to "extremely conservative"* 
*(6), and thus 3 represents ideological moderates*

gen Ideology = VCF0803
replace Ideology = . if VCF0803 == 0
replace Ideology = . if VCF0803 == 9
replace Ideology = 0 if VCF0803 == 1
replace Ideology = 1 if VCF0803 == 2
replace Ideology = 2 if VCF0803 == 3
replace Ideology = 3 if VCF0803 == 4
replace Ideology = 4 if VCF0803 == 5
replace Ideology = 5 if VCF0803 == 6
replace Ideology = 6 if VCF0803 == 7
label var Ideology ///
"Ideological Self-Identification"

*Recode ideology to range from "0" to "1"*

*Note: The variable is coded as such so that all primary predictors*
*of interest range from zero to one, enabling a clear comparison* 
*of effects*

replace Ideology = Ideology/6

****************
*Recode racial resentment variables*

*Note: We will create all scales, namely, the racial resentment, religiosity,* 
*social welfare issues,egalitarianism and moral traditionalism scales,* 
*after we merge these data with the 2016 ANES data*
****************

*Conditions have made it difficult for blacks to succeed*

gen Conditionsblack = VCF9039
replace Conditionsblack = . if VCF9039 == 8
replace Conditionsblack = . if VCF9039 == 9
replace Conditionsblack = 0 if VCF9039 == 1
replace Conditionsblack = 1 if VCF9039 == 2
replace Conditionsblack = 2 if VCF9039 == 3
replace Conditionsblack = 3 if VCF9039 == 4
replace Conditionsblack = 4 if VCF9039 == 5

*The "Conditonsblack" variable is coded as follows:*

*0 = Agree strongly*
*1 = Agree somewhat*
*2 = Neither agree nor disagree*
*3 = Disagree somewhat*
*4 = Disagree strongly*

*Blacks should get ahead without any special favors*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*

gen Blacksspecial = VCF9040
replace Blacksspecial = . if VCF9040 == 8
replace Blacksspecial = . if VCF9040 == 9
replace Blacksspecial = 0 if VCF9040 == 5
replace Blacksspecial = 1 if VCF9040 == 4
replace Blacksspecial = 2 if VCF9040 == 3
replace Blacksspecial = 3 if VCF9040 == 2
replace Blacksspecial = 4 if VCF9040 == 1

*The "Blacksspecial" variable is coded as follows:*

*0 = Disagree strongly*
*1 = Disagree somewhat*
*2 = Neither agree nor disagree*
*3 = Agree somewhat*
*4 = Agree strongly*

*Blacks could succeed if they would try harder*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative attitudes*

gen Blackstry = VCF9041
replace Blackstry = . if VCF9041 == 8
replace Blackstry = . if VCF9041 == 9
replace Blackstry = 0 if VCF9041 == 5
replace Blackstry = 1 if VCF9041 == 4
replace Blackstry = 2 if VCF9041 == 3
replace Blackstry = 3 if VCF9041 == 2
replace Blackstry = 4 if VCF9041 == 1

*The "Blackstry" variable is coded as follows:*

*0 = Disagree strongly*
*1 = Disagree somewhat*
*2 = Neither agree nor disagree*
*3 = Agree somewhat*
*4 = Agree strongly*

*Blacks have gotten less than they deserve*

gen Blacksgotless = VCF9042
replace Blacksgotless = . if VCF9042 == 8
replace Blacksgotless = . if VCF9042 == 9
replace Blacksgotless = 0 if VCF9042 == 1
replace Blacksgotless = 1 if VCF9042 == 2
replace Blacksgotless = 2 if VCF9042 == 3
replace Blacksgotless = 3 if VCF9042 == 4
replace Blacksgotless = 4 if VCF9042 == 5

*The "Blacksgotless" variable is coded as follows:*

*0 = Agree strongly*
*1 = Agree somewhat*
*2 = Neither agree nor disagree*
*3 = Disagree somewhat*
*4 = Disagree strongly*

****************
*Recode the retrospective economic evaluations variable*
*Note: This economic evaluations measure will be included as a control variable*
*in the model predicting partisanship*
****************

*Retrospective economic evaluations (one year)*

*Note: The unlabeled category is ".5," which is unlabeled due to the fact that*
*STATA does not allow non-integer value labels*

*Note: The variable is coded such that all primary predictors*
*of interest range from zero to one, enabling a clear comparison* 
*of effects*

gen Retrospective = VCF0870
replace Retrospective = . if VCF0870 == 8
replace Retrospective = 0 if VCF0870 == 5
replace Retrospective = .5 if VCF0870 ==3
label var Retrospective ///
"Evaluation of the Economy over the Past Year"
label define Retrospectives ///
0 "0 Worse" 1 "1 Better"
label values Retrospective Retrospectives 

****************
*Religiosity*

*Specifically, we follow Layman (1997) by creating a two-item scale of* 
*religiosity using the ANES biblical literalism and frequency of church* 
*attendance measures*
****************

*Biblical literalism*
*Note: This variable is reverse coded such that higher values indicate greater*
*greater religiosity*

*Note: The series for ANES Cumulative File variable VCF0845 was discontinued* 
*after 1988, meaning that this variable is constructed from both VCF0845 and*
*VCF0850 for the years 1992-2012*

*Note: The number of response categories differ across the two variables,* 
*which is why the two most liberal categories are combined in 1988*

gen Biblit = .
replace Biblit = 0 if VCF0845 == 3 & VCF0004 == 1988
replace Biblit = 0 if VCF0845 == 4 & VCF0004 == 1988
replace Biblit = 0 if VCF0850 == 3
replace Biblit = 1 if VCF0850 == 2
replace Biblit = 1 if VCF0845 == 2 & VCF0004 == 1988
replace Biblit = 2 if VCF0845 == 1 & VCF0004 == 1988
replace Biblit = 2 if VCF0850 == 1
label var Biblit "Biblical Literalism"

*Note: The categories for the biblical literalism variable in 1988 (VCF0845)* 
*are as follows*

*0 "The Bible was written by men who lived so long ago that it is worth very little today"
*0 "The Bible is a good book because it was written by wise men, but God had nothing to do with it"
*1 "The Bible was written by men inspired by God but it contains some human errors"
*2 "The Bible is God's word and all that it says is true"

*Note: The categories for the biblical literalism variable for the years* 
*1992-2012 (VCF0850) are as follows:*

*0 "The Bible is a book written by men and is not the word of God"
*1 "The Bible is the word of God but not everything in it should be taken literally, word for word"
*2 "The Bible is the actual word of God and is to be taken literally, word for word"

*Recode the biblical literalism variable to range between 0 and 1*

replace Biblit = Biblit/2

*Note: The variable is coded such that the eventual religiosity scale will*
*range from 0 to 1, meaning that all primary predictors of interest range* 
*from zero to one, enabling a clear comparison of effects*

*Church attendance*
*Note: This variable is reverse coded so that higher values indicate greater*
*greater religiosity*

gen Churchattend = VCF0130
replace Churchattend = . if VCF0130 == 0
replace Churchattend = . if VCF0130 == 7
replace Churchattend = . if VCF0130 == 8
replace Churchattend = . if VCF0130 == 9
replace Churchattend = 0 if VCF0130 == 5
replace Churchattend = 1 if VCF0130 == 4
replace Churchattend = 2 if VCF0130 == 3
replace Churchattend = 3 if VCF0130 == 2
replace Churchattend = 4 if VCF0130 == 1
label var Churchattend "Church Attendance"

*Note: The categories for the church attendance variable are as follows*

*0 "Never"
*1 "A few times a year" 
*2 "Once or twice a month"
*3 "Almost every week"*
*4 "Every week"

*Recode the Church attendance variable to range between 0 and 1*

replace Churchattend = Churchattend/4

*Note: The variable is coded such that the eventual religiosity scale will*
*range from 0 to 1, meaning that all primary predictors of interest range* 
*from zero to one, enabling a clear comparison of effects*

****************
*Recode values variables*

*Note: The eight individual questions comprising the two longest running ANES* 
*batteries of core values, egalitarianism (four questions) and moral* 
*traditionalism (four questions), will be combined into a single scale*
*ranging from zero to one in this analysis*

*Note: The resulting scale will serve as the primary independent variable* 
*of interest in the empirical analysis testing the potentially changing* 
*over time influence of region on the relationship* 
*between individuals' egalitarian postures and partisanship*

*Note: The ANES egalitarianism battery was unfortunately reduced from six*
*questions to four in 2016 after containing the same six questions in every*
*presidential election year from 1988 through 2012 (you're silly, ANES!)*
****************

****************
*Recode egalitarianism variables*

*Note: The equal opportunity, unequal variables and less equal variables* 
*are all reverse coded so that higher values indicate* 
*more conservative values*
****************

*Do whatever is necessary for equal opportunity*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*

gen Equalopp = VCF9013
replace Equalopp = . if VCF9013 == 8 
replace Equalopp = . if VCF9013 == 9
replace Equalopp = 0 if VCF9013 == 1
replace Equalopp = 1 if VCF9013 == 2
replace Equalopp = 2 if VCF9013 == 3
replace Equalopp = 3 if VCF9013 == 4
replace Equalopp = 4 if VCF9013 == 5
label var Equalopp /// 
"Our Society Should Do What is Necessary to Ensure Equal Opportunity"
label define Equalopportunity ///
0 "0 Agree strongly" 1 "1 Agree somewhat" ///
2 "2 Neither agree nor disagree" 3 "3 Disagree somewhat" 4 "4 Disagree strongly"
label values Equalopp Equalopportunity

*Not that big of a problem if people have more of a chance*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*

gen Unequal = VCF9016
replace Unequal = . if VCF9016 == 8
replace Unequal = . if VCF9016 == 9
replace Unequal = 0 if VCF9016 == 5 
replace Unequal = 1 if VCF9016 == 4 
replace Unequal = 2 if VCF9016 == 3 
replace Unequal = 3 if VCF9016 == 2 
replace Unequal = 4 if VCF9016 == 1 
label var Unequal /// 
"It Is Not That Big of a Problem if Some People Have More of a Chance in Life"
label define Unequalchance ///
0 "0 Disagree strongly" 1 "1 Disagree somewhat" ///
2 "2 Neither agree nor disagree" 3 "3 Agree somewhat" 4 "4 Agree strongly"
label values Unequal Unequalchance

*Better off if we worried less about equality*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*

gen Lessequal = VCF9017
replace Lessequal = . if VCF9017 == 8
replace Lessequal = . if VCF9017 == 9
replace Lessequal = 0 if VCF9017 == 5
replace Lessequal = 1 if VCF9017 == 4
replace Lessequal = 2 if VCF9017 == 3
replace Lessequal = 3 if VCF9017 == 2
replace Lessequal = 4 if VCF9017 == 1
label var Lessequal ///
"This Country Would Be Better Off if We Worried Less about Equality"
label define Lessequality ///
0 "0 Disagree strongly" 1 "1 Disagree somewhat" /// 
2 "2 Neither agree nor disagree" 3 "3 Agree somewhat" 4 "4 Agree strongly"
label values Lessequal Lessequality

*Many fewer problems if people were treated equally*

gen Fewer = VCF9018
replace Fewer = . if VCF9018 == 8
replace Fewer = . if VCF9018 == 9
replace Fewer = 0 if VCF9018 == 1
replace Fewer = 1 if VCF9018 == 2
replace Fewer = 2 if VCF9018 == 3
replace Fewer = 3 if VCF9018 == 4
replace Fewer = 4 if VCF9018 == 5
label var Fewer /// 
"If People Were Treated More Equally in this Country We Would Have Many Fewer Problems"
label define Treatequally ///
0 "0 Agree strongly" 1 "1 Agree somewhat" ///
2 "2 Neither agree nor disagree" 3 "3 Disagree somewhat" 4 "4 Disagree strongly"
label values Fewer Treatequally

****************
*Recode moral traditionalism variables*

*Note: The lifestyles and family variables are reverse coded so that higher* 
*values indicate more conservative values*
****************

*Newer lifestyles contributing to a breakdown in society*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*
 
gen Lifestyles = VCF0851
replace Lifestyles = . if VCF0851 == 8
replace Lifestyles = . if VCF0851 == 9
replace Lifestyles = 0 if VCF0851 == 5
replace Lifestyles = 1 if VCF0851 == 4
replace Lifestyles = 2 if VCF0851 == 3
replace Lifestyles = 3 if VCF0851 == 2
replace Lifestyles = 4 if VCF0851 == 1
label var Lifestyles /// 
"Newer Lifestyles are Contributing to the Breakdown of Society"
label define Lifestylesnew ///
0 "0 Disagree strongly" 1 "1 Disagree somewhat" /// 
2 "2 Neither agree nor disagree" 3 "3 Agree somewhat" 4 "4 Agree strongly"
label values Lifestyles Lifestylesnew

*Adjusting views of moral behavior*

gen Changing = VCF0852
replace Changing = . if VCF0852 == 8
replace Changing = . if VCF0852 == 9
replace Changing = 0 if VCF0852 == 1
replace Changing = 1 if VCF0852 == 2
replace Changing = 2 if VCF0852 == 3
replace Changing = 3 if VCF0852 == 4
replace Changing = 4 if VCF0852 == 5
label var Changing /// 
"We Should Adjust our Views of Moral Behavior to Changes in Society"
label define Changingmorals 0 "Agree strongly" 1 "Agree somewhat" /// 
2 "Neither agree nor disagree" 3 "Disagree somewhat" 4 "Disagree strongly"
label values Changing Changingmorals

*More emphasis on traditional family ties*
*Note: This variable is reverse coded so that higher values indicate* 
*more conservative values*
 
gen Family = VCF0853
replace Family = . if VCF0853 == 8
replace Family = . if VCF0853 == 9
replace Family = 0 if VCF0853 == 5
replace Family = 1 if VCF0853 == 4
replace Family = 2 if VCF0853 == 3
replace Family = 3 if VCF0853 == 2
replace Family = 4 if VCF0853 == 1
label var Family /// 
"This Country Would Have Many Fewer Problems if There Were More Emphasis on Traditional Family Ties"
label define Familyties /// 
0 "0 Disagree strongly" 1 "1 Disagree somewhat" /// 
2 "2 Neither agree nor disagree"  3 "3 Agree somewhat" 4 "4 Agree strongly"
label values Family Familyties
 
*Tolerant of people who choose to live according to their own moral standards*

gen Standards = VCF0854
replace Standards = . if VCF0854 == 8
replace Standards = . if VCF0854 == 9
replace Standards = 0 if VCF0854 == 1
replace Standards = 1 if VCF0854 == 2
replace Standards = 2 if VCF0854 == 3
replace Standards = 3 if VCF0854 == 4
replace Standards = 4 if VCF0854 == 5
label var Standards /// 
"More Tolerant of People Who Choose to Live According to Their Own Moral Standards"
label define Standardsown ///
0 "0 Agree strongly" 1 "1 Agree somewhat" ///
2 "2 Neither agree nor disagree" 3 "3 Disagree somewhat" 4 "4 Disagree strongly"
label values Standards Standardsown

****************
*Create behavioral dependent variables, namely, presidential and congressional*
*vote choice*
****************

*Presidential vote choice*

*Note: We exclude minor party candidates from this analysis*

gen Presvote = VCF0704a
replace Presvote = . if VCF0704a == 0
replace Presvote = 0 if VCF0704a == 1
replace Presvote = 1 if VCF0704a == 2
label var Presvote ///
"Presidential Vote Choice"
label define President ///
0 "0 Democratic candidate" 1 "1 Republican candidate"
label values Presvote President

*Congressional (House) vote choice*

gen Housevote = VCF0707
replace Housevote = . if VCF0707 == 0
replace Housevote = 0 if VCF0707 == 1
replace Housevote = 1 if VCF0707 == 2
label var Housevote ///
"Party Vote for the House"
label define Houserep ///
0 "0 Democratic candidate" 1 "1 Republican candidate"
label values Housevote Houserep

****************
keep VCF0004 VCF0006 White-Housevote
****************

****************
*We next these recoded these data as a Stata data file entitled*
*"Analyzing Partisan Change Plus Vote Choice Using the ANES Cumulative File (1988-2012 ANES)"*
****************

*We then open the 2016 ANES and recode it before appending the dataset*
*to the recoded ANES Cumulative File dataset in order to incorporate the* 
*2016 ANES into the ANES Cumulative File*

*The 2016 ANES source dataset is saved as the following Stata data* 
*file: "2016 ANES.dta"*

*The code used to recode the 2016 ANES is saved as a separate Stata do file*
*entitled "Recoding the 2016 ANES.do"

*The recoded 2016 ANES dataset that we will append to the recoded* 
*ANES Cumulative File is saved as a Stata data file entitled* 
*"Recoded 2016 ANES Data.dta"*
****************

****************
*We now append the recoded 2016 ANES dataset to our recoded ANES Cumulative* 
*File to create our analysis dataset
****************

append using "/Users/rnl17004/Documents/Documents/Co-authored Papers/Southern Partisan Change/JOP Revision/Stata Data/Recoded 2016 ANES Plus Vote Choice.dta"

*Check to ensure that the appending attempt was successful*

summarize

****************
*Create a time variable that will be interacted with core values and the*
*region variable in order to assess the potentially changing over time* 
*influence of egalitarianism on partisanship across regions*
*This three-way interaction will serve as the primary empirical relationship*
*of interest in the manuscript*

*Note: The time variable is an indicator of partisan polarization and* 
*begins in 1988 because 1988 was the first year in which the moral* 
*traditionalism battery was included on the ANES*
*Thus, the time variable takes a value of 0 in 1988 and 6 in 2016*

*Note: The time variable omits the year 1996 because the crucial racial*
*resentment battery used in this analysis was unfortunately and*
*inexplicably not asked in that year*

*Note: We first assign the value of 2016 to the ANES Cumulative File's survey*
*year variable, VCF0004, for all missing values, which in our recoded and* 
*appended dataset represent the year 2016*
****************

replace VCF0004 = 2016 if VCF0004 == .

*Time*

gen Time = .
replace Time = 0 if VCF0004 == 1988
replace Time = 1 if VCF0004 == 1992
replace Time = 2 if VCF0004 == 2000
replace Time = 3 if VCF0004 == 2004
replace Time = 4 if VCF0004 == 2008
replace Time = 5 if VCF0004 == 2012 
replace Time = 6 if VCF0004 == 2016

****************
*Complete the retrospective economic evaluations variable coding*

*Note: We complete this coding now because the interaction term requires*
*that we interact the economic retrospective evaluations constitutive term*
*with the newly created time variable*

*Note: This variable is coded 0, indicating Republican control of the* 
*White House, in 1988, 1992, 2004 and 2008*
*This variable is thus coded 1, indicating Democratic control of the* 
*White House, in 1996, 2000 and 2012*
****************

*Democratic incumbent president*

gen Dempres= .
replace Dempres = 0 if VCF0004 == 1988
replace Dempres = 0 if VCF0004 == 1992
replace Dempres = 0 if VCF0004 == 2004
replace Dempres = 0 if VCF0004 == 2008
replace Dempres = 1 if VCF0004 == 2000
replace Dempres = 1 if VCF0004 == 2012
replace Dempres = 1 if Time == 6
label var Dempres "Democratic Incumbent President"
label define Democraticpresident ///
0 "Republican president" 1 "Democratic president"
label values Dempres Democraticpresident

****************
*Create a multiplicative interaction term involving the retrospective*
*economic evaluations variable and the Democratic incumbent president variable*
*that will be included in our main regression models*

*Note: The constitutive economic retrospective evaluations term can now*
*be interpreted as the association between economic assessments and partisanship*
*when a Republican is the incumbent president, and the interaction term*
*captures the same relationship when a Democrat is the incumbent president*
*The constitutive Democratic president term is thus the estimated relationship* 
*between economic evaluations and partisanship when an individual
*believes that the economy has worsened and a Democrat occupies the White House*
****************

*Create an interaction term to capture the conditional effects* 
*of presidential control on the relationship between retrospective economic* 
*evaluations and partisanship*

gen Retdem = Retrospective*Dempres

****************
*Create all scales that will be used in the empirical analyses*
****************

****************
*Create a racial resentment scale*
****************

alpha Conditionsblack Blacksspecial Blackstry Blacksgotless, detail item ///
generate (Racialresentmentscale)

*Recode the racial resentment scale from 0 to 1*

*Note: The variable is coded such that all primary predictors*
*of interest range from zero to one, enabling a clear comparison* 
*of effects*

table Racialresentmentscale

replace Racialresentmentscale = Racialresentmentscale/4

****************
*Create a religiosity scale*
****************

alpha Biblit Churchattend, detail item generate(Religiosity)

****************
*Create an egalitarianism scale constructed from the four individual*
*egalitarianism indicators*
****************

*Egalitarianism*

alpha Equalopp Unequal Lessequal Fewer, ///
detail item generate (Egalitarianismscale)

*Recode the egalitarianism scale to range from 0 to 1*

replace Egalitarianismscale = Egalitarianismscale/4

*Note: The variable is coded such that all primary predictors*
*of interest range from zero to one, enabling a clear comparison* 
*of effects*

****************
*Create a moral traditionalism scale constructed from the four individual* 
*moral traditionalism indicators*
****************

*Moral traditionalism*

alpha Lifestyles Changing Family Standard, ///
detail item generate (Moralityscale) 

*Recode the moral traditionalism scale to range from 0 to 1*

replace Moralityscale = Moralityscale/4

*Note: The variable is coded such that all primary predictors*
*of interest range from zero to one, enabling a clear comparison* 
*of effects*

****************
*We now save our fully recoded and appended analysis data file, entitled*
*"Analyzing Partisan Change Plus Vote Choice Using the ANES Cumulative File, 1988-2012 ANES Plus the 2016 ANES.dta"
****************

****************
*Predict presidential and congressional (House) vote choice over time*

*Note: The following regression analyses are meant to assess our primary* 
*empirical analyses' robustness using behavioral indicators—specifically,*
*presidential and House vote choice—to demonstrate potential differences in* 
*the changing relationship between core values and politics among southerners* 
*and non-southerners*
****************

****************
*We first respecify the identical models featured in manuscript Table 2,*
*except now we substitute presidential vote choice for partisanship as the*
*modeled dependent variable* 

*Note: We of course will model presidential vote choice using a logistic*
*regression models given that we are modeling voters' preferences for either*
*the Democratic or Republican presidential candidate in their district*

*Note: We model only major party presidential vote choice for the*
*purpose of this analysis

*Note: The following code produces estimates used to create supplemental online*
*appendix Table A7 and Figure A6*
****************

****************
*Southerners*
****************

*Note: The following four regression models generate results for southerners*
*only*

*Note: The "estimates store" command lines are used because we will plot*
*the estimated coefficient for the interaction terms between each of our*
*key independent variables and time for southerners and non-southerners*

****************
*Ideology*
****************

logit Presvote c.Time##c.Ideology Egalitarianismscale ///
Moralityscale Racialresentmentscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 1
estimates store Ideolsouthpres

****************
*Egalitarianism*
****************

logit Presvote c.Time##c.Egalitarianismscale Ideology Moralityscale ///
Racialresentmentscale Religiosity Retrospective Retdem ///
Dempres Gender Age Education Income if South == 1
estimates store Egalsouthpres

****************
*Moral traditionalism*
****************

logit Presvote c.Time##c.Moralityscale Ideology Egalitarianismscale ///
Racialresentmentscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 1
estimates store Moralsouthpres

****************
*Racial resentment*
****************

logit Presvote c.Time##c.Racialresentmentscale Ideology Egalitarianismscale ///
Moralityscale Religiosity Retrospective Retdem Dempres Gender Age Education ///
Income if South == 1
estimates store Racesouthpres

****************
*Non-southerners*
****************

*Note: The following four regression models generate results* 
*for non-southerners only*

****************
*Ideology*
****************

logit Presvote c.Time##c.Ideology Racialresentmentscale Moralityscale ///
Egalitarianismscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 0
estimates store Ideolnonsouthpres

****************
*Egalitarianism*
****************

logit Presvote Ideology c.Time##c.Egalitarianismscale Moralityscale ///
Racialresentmentscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 0
estimates store Egalnonsouthpres

****************
*Moral traditionalism*
****************

logit Presvote Ideology c.Time##c.Moralityscale Egalitarianismscale ///
Racialresentmentscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 0
estimates store Moralnonsouthpres

****************
*Racial resentment*
****************

logit Presvote Ideology c.Time##c.Racialresentmentscale Moralityscale ///
Egalitarianismscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 0
estimates store Racenonsouthpres

****************
*Generate a coefficient plot to showcase the over time relationship between*
*each key independent variable and presidential vote choice over time across* 
*regions*

*Note: Again, the following code produces estimates used to create supplemental* 
*online appendix Figure A6*
****************

local times = char(215)
coefplot (Ideolsouthpres, mcolor(red) ciopts(lcolor(red*.50)) ///
keep(c.Time#c.Ideology) offset(-.1)) ///
(Ideolnonsouthpres, mlcolor(blue) mfcolor(white) msymbol(O) /// 
ciopts(lcolor(blue*.50)) ///
keep(c.Time#c.Ideology) offset(.1)) ///
(Egalsouthpres, mcolor(red) ciopts(lcolor(red*.50)) ///
keep(c.Time#c.Egalitarianismscale) offset(-.1)) ///
(Egalnonsouthpres,  mlcolor(blue) mfcolor(white) msymbol(O) /// 
ciopts(lcolor(blue*.50)) ///
keep(c.Time#c.Egalitarianismscale) offset(.1)) ///
(Moralsouthpres, mcolor(red) ciopts(lcolor(red*.50)) ///
keep(c.Time#c.Moralityscale) offset(-.1)) ///
(Moralnonsouthpres, mlcolor(blue) mfcolor(white) msymbol(O) ///
ciopts(lcolor(blue*.50)) ///
keep(c.Time#c.Moralityscale) offset(.1)) ///
(Racesouthpres, mcolor(red) ciopts(lcolor(red*.50)) ///
keep(c.Time#c.Racialresentmentscale) offset(-.1)) ///
(Racenonsouthpres, mlcolor(blue) mfcolor(white) msymbol(O) ///
ciopts(lcolor(blue*.50)) ///
keep(c.Time#c.Racialresentmentscale) offset(.1)), ///	
level(95) scheme(s1color) grid(none) ///
xtitle("Coefficient estimate") ylabel(1 "Ideology X Time" ///
2 "Egalitarianism X Time" 3 "Moral traditionalism X Time" ///
4 "Racial resentment X Time")  ///
legend(order(2 "Southerners" 4 "Non-Southerners") rows(1) size(medsmall)) ///
xsize(7.5) subtitle(, fcolor(dimgray)) drop(_cons) xline(0, lcolor(black) ///
lpattern(dash))

****************
*We now respecify the identical model as above, except now we substitute* 
*congressional vote choice as the modeled dependent variable* 

*Note: As with our presidential vote variable, we will model congressional* 
*vote choice using a logistic regression models given that we are modeling* 
*voters' preferences for either the Democratic or Republican House candidate* 
*in their district*

*Note: The following code produces estimates used to create supplemental online*
*appendix Table A8 and Figure A7*
****************

****************
*Southerners*
****************

*Note: The following four regression models generate results for southerners*
*only*

*Note: The "estimates store" command lines are used because we will plot*
*the estimated coefficient for the interaction terms between each of our*
*key independent variables and time for southerners and non-southerners*

****************
*Ideology*
****************

logit Housevote c.Time##c.Ideology Egalitarianismscale ///
Moralityscale Racialresentmentscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 1
estimates store Ideolsouthhouse

****************
*Egalitarianism*
****************

logit Housevote c.Time##c.Egalitarianismscale Ideology Moralityscale ///
Racialresentmentscale Religiosity Retrospective Retdem ///
Dempres Gender Age Education Income if South == 1
estimates store Egalsouthhouse

****************
*Moral traditionalism*
****************

logit Housevote c.Time##c.Moralityscale Ideology Egalitarianismscale ///
Racialresentmentscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 1
estimates store Moralsouthhouse

****************
*Racial resentment*
****************

logit Housevote c.Time##c.Racialresentmentscale Ideology Egalitarianismscale ///
Moralityscale Religiosity Retrospective Retdem Dempres Gender Age Education ///
Income if South == 1
estimates store Racesouthhouse

****************
*Non-southerners*
****************

*Note: The following four regression models generate results* 
*for non-southerners only*

****************
*Ideology*
****************

logit Housevote c.Time##c.Ideology Racialresentmentscale Moralityscale ///
Egalitarianismscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 0
estimates store Ideolnonsouthhouse

****************
*Egalitarianism*
****************

logit Housevote Ideology c.Time##c.Egalitarianismscale Moralityscale ///
Racialresentmentscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 0
estimates store Egalnonsouthhouse

****************
*Moral traditionalism*
****************

logit Housevote Ideology c.Time##c.Moralityscale Egalitarianismscale ///
Racialresentmentscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 0
estimates store Moralnonsouthhouse

****************
*Racial resentment*
****************

logit Housevote Ideology c.Time##c.Racialresentmentscale Moralityscale ///
Egalitarianismscale Religiosity Retrospective ///
Retdem Dempres Gender Age Education Income if South == 0
estimates store Racenonsouthhouse

****************
*Note: We resave the dataset adding these newly stored estimates from the*
*preceding estimates*
****************

****************
*Generate a coefficient plot to showcase the over time relationship between*
*each key independent variable and congressional vote choice over time across* 
*regions*

*Note: Again, the following code produces estimates used to create supplemental* 
*online appendix Figure A7
****************

local times = char(215)
coefplot (Ideolsouthhouse, mcolor(red) ciopts(lcolor(red*.50)) ///
keep(c.Time#c.Ideology) offset(-.1)) ///
(Ideolnonsouthhouse, mlcolor(blue) mfcolor(white) msymbol(O) /// 
ciopts(lcolor(blue*.50)) ///
keep(c.Time#c.Ideology) offset(.1)) ///
(Egalsouthhouse, mcolor(red) ciopts(lcolor(red*.50)) ///
keep(c.Time#c.Egalitarianismscale) offset(-.1)) ///
(Egalnonsouthhouse,  mlcolor(blue) mfcolor(white) msymbol(O) /// 
ciopts(lcolor(blue*.50)) ///
keep(c.Time#c.Egalitarianismscale) offset(.1)) ///
(Moralsouthhouse, mcolor(red) ciopts(lcolor(red*.50)) ///
keep(c.Time#c.Moralityscale) offset(-.1)) ///
(Moralnonsouthhouse, mlcolor(blue) mfcolor(white) msymbol(O) ///
ciopts(lcolor(blue*.50)) ///
keep(c.Time#c.Moralityscale) offset(.1)) ///
(Racesouthhouse, mcolor(red) ciopts(lcolor(red*.50)) ///
keep(c.Time#c.Racialresentmentscale) offset(-.1)) ///
(Racenonsouthhouse, mlcolor(blue) mfcolor(white) msymbol(O) ///
ciopts(lcolor(blue*.50)) ///
keep(c.Time#c.Racialresentmentscale) offset(.1)), ///	
level(95) scheme(s1color) grid(none) ///
xtitle("Coefficient estimate") ylabel(1 "Ideology X Time" ///
2 "Egalitarianism X Time" 3 "Moral traditionalism X Time" ///
4 "Racial resentment X Time")  ///
legend(order(2 "Southerners" 4 "Non-Southerners") rows(1) size(medsmall)) ///
xsize(7.5) subtitle(, fcolor(dimgray)) drop(_cons) xline(0, lcolor(black) ///
lpattern(dash))

